<template>
  <van-tabs v-model:active="active">
    <van-tab title="简介">简介</van-tab>
    <van-tab title="目录">目录</van-tab>
    <van-tab title="评论">评论</van-tab>
  </van-tabs>
  <van-submit-bar button-text="加入购物车" @submit="onSubmit" />
</template>
<script>
import { useRoute } from "vue-router";
import { reactive, toRefs, ref } from "vue"
export default {
  setup(){
    const active = ref(0)
    const route = useRoute()
    const state = reactive({
      name: route.query.name
    })
    // onBeforeMount(() => {
    //   console.log(route.query.name)
    //   state.name= route.query.name
    // })
    return {
      active,
      ...toRefs(state)
    };
  }
}
</script>

<style scoped>

</style>
